<?php
require_once FOREGROUND_COMMON_ACTION_SERVICE_DIR . '/ajax.php';

class foreground_member_login_captcha_action_service extends foreground_ajax_common_action_service
{
    protected static $_instance;

    public static function get_instance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }


    protected function _current_page_process()
    {	     
	    $captcha_handler = wwy_resource_container::get_captcha_handler();
	     
	    //生成验证码【字符串】
	    $code = $captcha_handler->generate_code();
	
	    //生成并【输出】图片
	    @ob_end_clean(); //清除之前出现的多余输入
	    $font_path = PROJECT_ROOT_PATH . '/public/module/common/css/fonts/SIMLI.TTF';
	    $captcha_handler->generate_image($font_path, $code);
	    	    
	    wwy_action::$data['member_login_captcha'] = $code;
    }
}